function showHintMailUsr(str)
{
    var xmlhttp;
    if (str.length==0)
    { 
        document.getElementById("txtHint").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","gethintMail.jsp?q="+str,true);
    xmlhttp.send();
}

function showHintGrupos(str)
{
    var xmlhttp;
    if (str.length==0)
    { 
        document.getElementById("txtHint").innerHTML="";
        return;
    }
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","gethintGrupos.jsp?q="+str,true);
    xmlhttp.send();
}
            
function resaltar(id){
    document.getElementById(id).style.backgroundColor = '#E5E5FF';
}
            
function quitarResaltar(id){
    document.getElementById(id).style.backgroundColor = 'transparent';
}
            
function seleccionar(valor){
    document.getElementById("txtMailUsr").value = valor;
    showHintMailUsr("");
    document.forms['formListarUsr'].submit();
}

function seleccionarGrupo(valor){
    document.getElementById("txtGrupos").value = valor;
    showHintGrupos("");
    document.forms['formListarGrupos'].submit();
}

function verificarNick(str){
    
    var xmlhttp;
    /*if (str.length==0)
    { 
        document.getElementById("spanNick").innerHTML="<br/>";
        return;
    }*/
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("spanNick").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","verificarNick.jsp?nick="+str,true);
    xmlhttp.send();
    
}

function verificarMail(str){
    
    var xmlhttp;
    
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("spanMail").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","verificarMail.jsp?mail="+str,true);
    xmlhttp.send();
    
}
